package com.itheima.map;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Demo03 {

    public static void main(String[] args) {
        Map<String,String> map= new HashMap<>();
        map.put("马蓉","宝强");
        map.put("马蓉","宋喆");
        map.put("小美","宝强");
        map.put("小璐","乃亮");
        map.put("小璐","PGone");
        map.put("anglebaby","小明");


        //获取所有的键的集合
        Set<String> keys = map.keySet();

        //遍历set
        keys.forEach(k-> System.out.println(k+"@@@"+map.get(k)));

        for (String key : keys) {
            System.out.println(key+"###"+map.get(key));
        }

        Iterator<String> iterator = keys.iterator();
        while (iterator.hasNext()){
            String key = iterator.next();
            System.out.println(key+"$$$$"+map.get(key));
        }

    }
}
